/*
   Project AwesOmeScript
   Copyright 2010 Domenico Gentner

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef ICONSELECTORDIALOG_HPP
#define ICONSELECTORDIALOG_HPP

class Mainframe;

class MyDirTraverser : public wxDirTraverser
{
public:
	MyDirTraverser(wxArrayString& files) : m_dirs(files) { }

	virtual wxDirTraverseResult OnFile(const wxString& filename)
	{
		return wxDIR_CONTINUE;
	}

	virtual wxDirTraverseResult OnDir(const wxString& dirname)
	{
		m_dirs.Add(dirname);
		return wxDIR_CONTINUE;
	}

private:
	wxArrayString& m_dirs;
};



class IconBrowser : public wxFrame
{
public:
	IconBrowser(Mainframe* parent);
	int GetSelectedIconNumber() const {return m_selected_icon; }

	static void DoSortImages( wxWindow* parent, const wxString& path, const wxString& to = wxEmptyString);

protected:
	void OnMyClose(wxCloseEvent&);
	void OnListItemDblClicked(wxListEvent&);

private:
	int m_selected_icon;
	wxNotebook* m_notebook;
	Mainframe* m_mainframe;

	void DoReadImages(const wxString& path, wxListCtrl* ctrl);

	DECLARE_EVENT_TABLE();
};


#endif // ICONSELECTORDIALOG_HPP
